package com.engr.springbooteasypoi.design.chain.client;

import com.engr.springbooteasypoi.design.chain.Filter;
import com.engr.springbooteasypoi.design.chain.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program springboot-easypoi
 * @description:
 * @author: LiuYanXin
 * @create: 2020-09-27 11:48
 */
@Service
public class ClientTest {

    @Autowired
    private List<Filter> filters;

    public void mockedClient() {
        Task task = new Task("yanxin", 24); // 这里task一般是通过数据库查询得到的
        for (Filter filter : filters) {
            if (!filter.filter(task)) {
                return;
            }
        }
    }
}
